package com.huai.kdzhan.parentCode.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.huai.kdzhan.parentCode.dao.ICrudDao;
import com.huai.kdzhan.parentCode.po.BaseEntity;
import com.huai.kdzhan.parentCode.service.ICrudService;
import org.springframework.stereotype.Service;

import java.util.List;

//这里不需要也不能添加@Service
public class CrudServiceImpl<T extends BaseEntity> extends ServiceImpl<ICrudDao<T>,T> implements ICrudService<T> {

    //分页查询
    @Override
    public PageInfo<T> selectPage(int pageNum, int pageSize, T entity) {
        return PageHelper.startPage(pageNum,pageSize).doSelectPageInfo(()-> {
            getBaseMapper().selectByPage(entity);
        });
    }

}
